]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/icon-theme: Disconnect from settings signals on disposal
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 20 Mar 2023 20:23:36 +0000 (21:23 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 21 Mar 2023 12:17:24 +0000 (12:17 +0000)
Icon themes can be created by extensions and thus are likely destroyed on
extension unload, so we must disconnect from StSettings signals to avoid
accessing to invalid memory.

See: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2012021
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2711>

src/st/st-icon-theme.c

index dc3f8cedc9cce45d95acf82e2a84878e4dc17aa4..d6f68afbbe0ee0e29e5190c43e3a2c466bdc75f0 100644 (file)
@@ -478,8 +478,8 @@ st_icon_theme_init (StIconTheme *icon_theme)
   icon_theme->pixbuf_supports_svg = pixbuf_supports_svg ();
 
   settings = st_settings_get ();
-  g_signal_connect (settings, "notify::gtk-icon-theme",
-                    G_CALLBACK (theme_changed), icon_theme);
+  g_signal_connect_object (settings, "notify::gtk-icon-theme",
+                           G_CALLBACK (theme_changed), icon_theme, 0);
   update_current_theme (icon_theme);
 }